Skip to content

Commit abeffab

Browse files
committed
add recent revs filtering checkbox
1 parent 0b778ea commit abeffab

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

kitsune/sumo/static/sumo/scss/layout/_contributors.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@
7474
width: 100%;
7575
max-width: none;
7676
margin: 0 0 p.$spacing-md 0;
77+
78+
&[type="checkbox"] {
79+
width: auto;
80+
margin-right: p.$spacing-md;
81+
margin-left: p.$spacing-xs;
82+
}
7783
}
7884

7985
img {
@@ -86,7 +92,6 @@
8692
select,
8793
input {
8894
margin: 0 10px;
89-
9095
}
9196
}
9297
}
@@ -263,4 +268,4 @@ ol.headings-list {
263268
}
264269
}
265270
}
266-
}
271+
}

kitsune/wiki/forms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,5 +426,6 @@ class RevisionFilterForm(forms.Form):
426426

427427
locale = forms.ChoiceField(label=_lazy("Locale:"), choices=languages, required=False)
428428
users = MultiUsernameFilterField(label=_lazy("Users:"), required=False)
429+
include_bots = forms.BooleanField(label=_lazy("Bots:"), required=False)
429430
start = forms.DateField(label=_lazy("Start:"), required=False)
430431
end = forms.DateField(label=_lazy("End:"), required=False)

kitsune/wiki/views.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
smart_int,
4040
truncated_json_dumps,
4141
)
42+
from kitsune.users.models import Profile
4243
from kitsune.wiki.config import (
4344
CATEGORIES,
4445
COLLAPSIBLE_DOCUMENTS,
@@ -1706,6 +1707,9 @@ def _show_revision_warning(document, revision):
17061707
def recent_revisions(request):
17071708
request.GET = request.GET.copy()
17081709
fragment = request.GET.pop("fragment", None)
1710+
if not fragment:
1711+
request.GET.setdefault("include_bots", "on")
1712+
17091713
form = RevisionFilterForm(request.GET)
17101714

17111715
# Validate the form to populate cleaned_data, even with invalid usernames.
@@ -1720,6 +1724,9 @@ def recent_revisions(request):
17201724
if form.cleaned_data.get("users"):
17211725
filters.update(creator__in=form.cleaned_data["users"])
17221726

1727+
if not form.cleaned_data.get("include_bots"):
1728+
filters.update(creator__profile__account_type=Profile.AccountType.REGULAR)
1729+
17231730
start = form.cleaned_data.get("start")
17241731
end = form.cleaned_data.get("end")
17251732
if start or end:

0 commit comments

Comments
 (0)